Random Number Generation What is random number? and What is the use of it? Random numbers: A sequence of numbers obtained by random sampling is said to be random numbers. Some of its uses are
1.A tool for obtaining a random sample from actual finite population
As a source of manufactured data to use in studying sampling phenomena
3.As a tool to estimate the quantity which is not tractable with mathematics
A good reference is Ross, M (2006), Simulation, Elsevier You can find several inbuilt command for generating random numbers from standard distributions. Using the command like rnorm(100), rnorm(100,2,10), runif(100) you can generate random numbers. Suppose we want to generate random numbers from triangular distribution, what we will do. There are several method to generate random numbers. Most popular among them are inverse transformation method. acceptance-rejection method, sums and mixture and transformation methods. After understanding the concepts of inverse transformation method, please go through the following program so that it will save your time! To generate a random sample of size 10000 from the distribution with density f(x)=3x^2, 0<x<1. To generate Bernoulli (p=.4) #clearly F(0)=1-p and F(1)=1
To generate geometric random variable To Generate Poisson random variable Note: Like the Poisson case. one can write similar program for binomial random variable.
|